.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.stack 200
.data
__error_resta db "RESULTADO NEGATIVO EN RESTA", 0
__error_overflow db "OVERFLOW EN PRODUCTO", 0
__error_division db "ERROR EN DIVISION", 0
__error db "ERROR", 0
_4ui dw 4
_9ui dw 9
_BIEN db "BIEN", 0
_1ui dw 1
_6ui dw 6
_2ui dw 2
_d dd ?
_7ui dw 7
_c dd ?
_3ul dd 3
_b dw ?
_a dw ?
_MAL db "MAL", 0
_4ul dd 4
.code
start:
MOV bx, _1ui
MOV _a, bx
MOV bx, _2ui
MOV _b, bx
MOV ebx, _3ul
MOV _c, ebx
MOV ebx, _4ul
MOV _d, ebx
MOV bx, _a
ADD bx, _b
ADD bx, _a
ADD bx, _b
MOV ecx, 0
MOV cx, bx
MOV _d, ecx
MOV ecx, 0
MOV cx, _6ui
MOV eax, _d
CMP eax, ecx
JNE @Label30
invoke MessageBox, NULL, addr _BIEN, addr _BIEN, MB_OK
JMP @Label32
@Label30:
invoke MessageBox, NULL, addr _MAL, addr _MAL, MB_OK
@Label32:
MOV bx, _a
ADD bx, _b
MOV ecx, 0
MOV cx, bx
ADD ecx, _c
MOV eax, 0
MOV ax, _a
ADD ecx, eax
MOV _d, ecx
MOV ecx, 0
MOV cx, _7ui
MOV eax, _d
CMP eax, ecx
JNE @Label50
invoke MessageBox, NULL, addr _BIEN, addr _BIEN, MB_OK
JMP @Label52
@Label50:
invoke MessageBox, NULL, addr _MAL, addr _MAL, MB_OK
@Label52:
MOV bx, _a
ADD bx, _b
MOV ecx, 0
MOV cx, bx
ADD ecx, _c
ADD ecx, _c
MOV _d, ecx
MOV ecx, 0
MOV cx, _9ui
MOV eax, _d
CMP eax, ecx
JNE @Label70
invoke MessageBox, NULL, addr _BIEN, addr _BIEN, MB_OK
JMP @Label72
@Label70:
invoke MessageBox, NULL, addr _MAL, addr _MAL, MB_OK
@Label72:
MOV ecx, 0
MOV cx, _a
ADD ecx, _c
MOV _d, ecx
MOV ecx, 0
MOV cx, _4ui
MOV eax, _d
CMP eax, ecx
JNE @Label86
invoke MessageBox, NULL, addr _BIEN, addr _BIEN, MB_OK
JMP @Label88
@Label86:
invoke MessageBox, NULL, addr _MAL, addr _MAL, MB_OK
@Label88:
MOV ecx, 0
MOV cx, _b
ADD ecx, _c
MOV eax, 0
MOV ax, _a
ADD ecx, eax
MOV _d, ecx
MOV ecx, 0
MOV cx, _6ui
MOV eax, _d
CMP eax, ecx
JNE @Label104
invoke MessageBox, NULL, addr _BIEN, addr _BIEN, MB_OK
JMP @Label106
@Label104:
invoke MessageBox, NULL, addr _MAL, addr _MAL, MB_OK
@Label106:
jmp fin
overflow:
invoke MessageBox, NULL, addr __error_overflow, addr __error, MB_OK
invoke ExitProcess, 0
res_negativo:
invoke MessageBox, NULL, addr __error_resta, addr __error, MB_OK
invoke ExitProcess, 0
division:
invoke MessageBox, NULL, addr __error_division, addr __error, MB_OK
invoke ExitProcess, 0
fin:
invoke ExitProcess, 0
end start